package net.sk.china.city.talk.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import net.sk.china.city.talk.dao.SensitiveLogDao;
import net.sk.china.city.talk.model.SensitiveLog;
import net.sk.china.city.talk.service.SensitiveLogService;
import net.sk.china.common.request.PageParamRequest;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * SensitiveLogServiceImpl 接口实现
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/3 18:29
 * +----------------------------------------------------------------------
 */

@Service
public class SensitiveLogServiceImpl extends ServiceImpl<SensitiveLogDao, SensitiveLog> implements SensitiveLogService {

    @Resource
    private SensitiveLogDao dao;

    /**
     * 列表
     * @param page 分页
     * @return {@code List<SensitiveLog> getList}
     */
    @Override
    public List<SensitiveLog> getList(PageParamRequest page) {
        PageHelper.startPage(page.getPage(), page.getLimit());

        LambdaQueryWrapper<SensitiveLog> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.orderByDesc(SensitiveLog::getId);

        return dao.selectList(lambdaQueryWrapper);
    }
}
